package at.jsug.topicvoting.gwt1.client.view.table;

import at.jsug.topicvoting.gwt1.client.remote.IDataMonitor;
import at.jsug.topicvoting.gwt1.client.remote.IDataFacade;
import at.jsug.topicvoting.gwt1.client.vo.Topic;

public class TopicsTable extends AbstractTable<Topic> implements IDataMonitor {
	
	private final IDataFacade dataService;
	
	public TopicsTable(IDataFacade dataService) { 
	    super(new TopicsTableColumnModel());
	    
	    this.dataService = dataService;
	    this.dataService.addMonitor(this);

	    this.addTableRows(this.dataService.getTopics());
	}
	
	public void dataChanged() {
		this.resetTableRows(this.dataService.getTopics());
	}
	
}
